fix(agents): preserve format guard recovery - #2985
Conversation
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 39 minutes Your organization has reached its usage spending cap. Adjust your spending cap in the billing tab. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe change updates mirrored logging scripts and workflow templates. Optimizer workflows capture deduplication failures. Format guard workflows distinguish accepted dispatches from failed requests and manage the ChangesWorkflow reliability updates
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant FormatGuard
participant GitHubActions
participant IssueLabels
FormatGuard->>GitHubActions: Dispatch optimizer workflow
GitHubActions-->>FormatGuard: Return CLI failure
FormatGuard->>GitHubActions: Query matching runs after dispatch time
GitHubActions-->>FormatGuard: Report accepted run or no matching run
FormatGuard->>IssueLabels: Preserve or remove agents:format lease
Possibly related PRs
Suggested labels: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Workflow source detectedPR #2985 now has valid workflow source context (origin=sync_campaign). No linked GitHub issue is required for this PR. |
There was a problem hiding this comment.
Pull request overview
This PR hardens the agents issue-format “lease”/handoff flow and logging so failed dispatches remain retryable, advisory dedup does not break the job under bash -e, and info-level logs don’t get emitted as errors—while keeping consumer templates mirrored with the source workflows.
Changes:
- Release the
agents:formatlabel lease when the format-guard cannot dispatch the optimizer, so later guard runs can retry. - Run the advisory issue-dedup Python block with
errexittemporarily disabled, capturing its exit code and restoring-eafterward. - Fix
logWithCorefallback logging so non-warning/non-error levels useconsole.log, and mirror all workflow/script changes intotemplates/consumer-repo/.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/workflows/test_agents_issue_optimizer_format_trigger.py | Extends assertions to ensure the format lease is explicitly released on dispatch failure before emitting the retryable error marker. |
| .github/workflows/agents-issue-format-guard.yml | Removes agents:format label on optimizer dispatch failure to avoid leaving a stuck lease. |
| templates/consumer-repo/.github/workflows/agents-issue-format-guard.yml | Mirrors the same lease-release-on-dispatch-failure behavior for consumer templates. |
| .github/workflows/agents-issue-optimizer.yml | Wraps advisory dedup Python execution with set +e/set -e so failures become warnings instead of aborting the step. |
| templates/consumer-repo/.github/workflows/agents-issue-optimizer.yml | Mirrors the same advisory dedup error-handling behavior for consumer templates. |
| .github/scripts/github-api-with-retry.js | Preserves info-level severity by using console.log (not console.error) for non-warning/non-error fallback logging. |
| templates/consumer-repo/.github/scripts/github-api-with-retry.js | Mirrors the logging fallback severity fix for consumer templates. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/agents-issue-format-guard.yml:
- Around line 207-208: Update the dispatch failure handling in both
.github/workflows/agents-issue-format-guard.yml (lines 207-208) and
templates/consumer-repo/.github/workflows/agents-issue-format-guard.yml (lines
207-208): reconcile the failed gh workflow run dispatch using run details or a
unique marker, and remove the agents:format lease only when no accepted dispatch
is found; otherwise preserve the lease to prevent duplicate runs.
In `@tests/workflows/test_agents_issue_optimizer_format_trigger.py`:
- Around line 84-87: Strengthen the assertions in the test around the generated
workflow trigger text so they match the complete failure-handling block,
including the `if ! gh workflow run ...; then` condition, the `--remove-label
"agents:format"` cleanup, and the retry warning message. Assert the warning
branch structure and ordering together, rather than only comparing independent
positions, so unconditional or success-path label removal cannot satisfy the
test.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 490e3ac7-6f02-4936-b0c3-acf25943a1eb
📒 Files selected for processing (7)
.github/scripts/github-api-with-retry.js.github/workflows/agents-issue-format-guard.yml.github/workflows/agents-issue-optimizer.ymltemplates/consumer-repo/.github/scripts/github-api-with-retry.jstemplates/consumer-repo/.github/workflows/agents-issue-format-guard.ymltemplates/consumer-repo/.github/workflows/agents-issue-optimizer.ymltests/workflows/test_agents_issue_optimizer_format_trigger.py
🤖 Keepalive Loop StatusPR #2985 | Agent: Codex | Iteration 0/12 Current State
🔍 Failure Classification| Error type | infrastructure |
|
Keepalive Work Log (click to expand)
|
|
Runner dispatch state for codex on PR #2985. Do not edit. |
Preserve agents:format when gh workflow run errors after GitHub accepts the optimizer dispatch; release only when no matching run appears. Co-authored-by: Cursor <cursoragent@cursor.com>
Refresh pair.11 hashes after the shared bash -e advisory dedup wrap so Health 74 stops treating intentional root/consumer divergence as drift. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Runner dispatch state for autofix on PR #2985. Do not edit. |
|
Autofix updated these files:
|
🤖 Bot Comment Handler
The agent has been assigned to this PR to address the bot review comments. Instructions for agent
The bot comment handler workflow has prepared context in the artifacts. |
Provider Comparison ReportProvider Summary
📋 Full Provider Details (click to expand)openai
anthropic
Agreement
Disagreement
Unique Insights
🔍 LangSmith Traces |
Closer verifier disposition (split report)Provider report on merged PR #2985 (comment 5229813293): openai CONCERNS (84%) / anthropic PASS (72%). Audited against current
Disposition: accept anthropic PASS for stated scope; record openai residual as known hardening debt (unguarded acceptance poll). Closer will address in a bounded follow-up or same-round complex fix if capacity remains after open PR drain. No issue to close. |
Fixes source-owned findings from the current sync wave.
Validation:
Summary by CodeRabbit
Bug Fixes
Tests
Chores